<%@ page language="java" contentType="text/html; charset=UTF-8"
	import="com.zmht.specedu.vo.Teachbook,com.zmht.specedu.vo.Soundstudy,java.util.*,com.zmht.specedu.rescue.web.form.TargetForm,com.zmht.specedu.vo.Soundstudy"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%
    /**
     * @author 谭湘元
     * @since 2009/04/23
     */
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb18030" />
<title>聋校备课与语言学习及矫治系统</title>
<fmt:setBundle basename="PathResource" scope="session" />
<link
	href="<%=request.getContextPath()%>/<fmt:message key='StylePath' />style.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<fmt:message key='datePicker' />WdatePicker.js"></script>
<script type="text/javascript">
	function createEvaluate(){
		if(evaluateText==""){
			alert("请先进行评价！");
			return;
		}
		if(document.forms[0].bookType.value==""){
			alert("请先选择教材类别！");
			return;
		}
		if(document.forms[0].bookID.value==""){
			alert("请先选择教材！");
			return;
		}
		if(document.forms[0].classID.value==""){
			alert("请先选择班级！");
			return;
		}
		var radios = document.getElementsByName("result");
		var result="";
		for(var i=0;i<radios.length;i++){
			if(radios[i].checked){
				result = radios[i].value;
			}
		}
		if(result==""){
			alert("请先选择评价结果！");
			return;
		}else if(result=="替代"){
			var replaceSoundText = document.forms[0].replaceSound.value;
			if(replaceSoundText==""){
				alert("请先填写替代音！");
				document.forms[0].replaceSound.focus();
				return;
			}
		}
		var studentID = document.forms[0].studentID.value;
		if(studentID==""){
			alert("请先选择学生！");
			return;
		}
		document.forms[0].content.value=document.getElementById("bookName"+document.forms[0].bookID.value).value;
		
		document.forms[0].method.value="addEvaluation";
		document.forms[0].submit();
	}
	window.onload = function(){
		var successFlag = "<c:out value="${addTeachPlanSuccess}" />"
		if(successFlag!="")
			alert(successFlag);
	}
	var evaluateText;
	function evaluationClick(radio,replaceText){
		evaluateText = radio.value;
		if(radio.value=="替代"){
			replaceText.disabled = !radio.checked;
		}else{
			if(radio.checked){
				replaceText.value = "";
				replaceText.disabled = "false";
			}
		}
	}
	function bookChanged(obj,content){
		
	}
</script>
</head>

<body  class="bcolor">
<html:form action="evaluation.do" method="post">
	<input type="hidden" name="method" value="toAddEvaluation" />
	<html:hidden property="content"/>
  <table cellspacing="0" cellpadding="0" width="99%" align="center" border="0">
	<tbody>
	<tr>
        <td width="7"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_01.gif" width="7" /></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_05.gif"><table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tbody>
              <tr>
                <td width="30"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_02.gif" width="30" /></td>
                <td align="left" width="200" background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_03.gif">&nbsp;<strong> 增 加 评 价 记 录</strong></td>
                <td width="59"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_04.gif" width="59" /></td>
                <td>&nbsp;</td>
              </tr>
            </tbody>
        </table></td>
        <td width="8"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_06.gif" width="8" /></td>
    </tr>
    <tr>
		<td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_07.gif"><img height="1" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />spacer.gif" width="1" /></td>
        <td bgcolor="#f7fbff">
      <table cellspacing="0" bordercolordark="#ccccff" cellpadding="0" width="100%" bordercolorlight="#ffffff" border="0">
	  	<tbody>
          <tr>
            <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                <tr>
                  <td width="15%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">教材类别：</td>
                  <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                    <select name="bookType" onchange="document.forms[0].submit();" style="width:220px;">
						<c:forEach items="${teackBookTypes}" var="item">
							<option value="<c:out value="${item.id }" />" <c:if test="${item.id == evaluationForm.bookType}">selected</c:if> ><c:out value="${item.name }" /></option>
						</c:forEach>
					</select>
                      <span class="STYLE4">*</span></td>
                </tr>
            </table></td>
          </tr>
		  <tr>
            <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                <tr>
                  <td width="15%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">教材：</td>
                  <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                    <select name="bookID" onchange="bookChanged(this,content);" style="width:220px;">
						<c:forEach items="${teachBooks}" var="item">
							<option value="<c:out value="${item.bookId}" />" <c:if test="${item.bookId == evaluationForm.bookID}">selected</c:if> ><c:out value="${item.tbookName}" /></option>
						</c:forEach>
					</select>
						<c:forEach items="${teachBooks}" var="item">
							<input type="hidden" id="bookName<c:out value="${item.bookId}" />" name="<c:out value="${item.bookId}" />" value="<c:out value="${item.tbookName}" />" />
						</c:forEach>
                      <span class="STYLE4">*</span></td>
                </tr>
            </table></td>
          </tr>
		  <tr>
            <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                <tr>
                  <td width="15%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">班级类别：</td>
                  <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                  	<html:radio property="classType" value="0" onclick="javascript:if(this.checked)document.forms[0].submit();"></html:radio>集体班 
                  	<html:radio property="classType" value="1" onclick="javascript:if(this.checked)document.forms[0].submit();"></html:radio>单训组   <span class="STYLE4">*</span>
				  </td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                <tr>
                  <td width="15%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">班级：</td>
                  <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
	                  <select name="classID" style="width:220px;" onchange="document.forms[0].submit();">
						<option value="">请选择班级...</option>
						<c:if test="${evaluationForm.classType==0}">
							<c:forEach items="${classess}" var="vc" varStatus="status">
								<option value="<c:out value="${vc.classId }" />" <c:if test="${vc.classId==evaluationForm.classID }">selected</c:if> >
									<c:out value="${vc.grades.name }" /><c:out value="${vc.classNumber }" />班
								</option>
							</c:forEach>
						</c:if>
						<c:if test="${evaluationForm.classType==1}">
							<c:forEach items="${specialGroups}" var="vc" varStatus="status">
								<option value="<c:out value="${vc.onlyClassId }" />" <c:if test="${vc.onlyClassId==evaluationForm.classID}">selected</c:if> >
									<c:out value="${vc.name }" />
								</option>
							</c:forEach>
						</c:if>
					  </select> <span class="STYLE4">*</span>
                  </td>
                </tr>
            </table></td>
          </tr>
		  <tr>
            <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                <tr>
                  <td width="15%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">学生：</td>
                  <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                    <select name="studentID" style="width:220px;">
						<c:forEach items="${studentList}" var="item">
							<option value="<c:out value="${item.studentId}" />" <c:if test="${item.studentId == evaluationForm.studentID}">selected</c:if> ><c:out value="${item.sname}" /></option>
						</c:forEach>
					</select>
                      <span class="STYLE4">*</span></td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                <tr>
                  <td width="15%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">评价结果：</td>
                  <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
             		<table width="330px;" border="0" cellspacing="0" cellpadding="0" style="display: inline;">
				  <tr>
					<td align="center" width="5px;" align="right"><html:radio onclick="evaluationClick(this,replaceSound);" property="result" value="正确" /></td>
					<td align="center" width="25px;" align="left">正确</td>
					<td align="center" width="5px;" align="right"><html:radio onclick="evaluationClick(this,replaceSound);" property="result" value="歪曲" /></td>
					<td align="center" width="25px;" align="left">歪曲</td>
					<td align="center" width="5px;" align="right"><html:radio onclick="evaluationClick(this,replaceSound);" property="result" value="丢失" /></td>
					<td align="center" width="25px;" align="left">丢失</td>
					<td align="center" width="5px;" align="right"><html:radio onclick="evaluationClick(this,replaceSound);" property="result" value="替代" /></td>
					<td align="center" width="25px;" align="left">替代</td>
					<td align="right">具体内容：</td>
					<td align="left">
					  <html:text property="replaceSound" styleClass="boxcopy2" disabled="true" style="width:60px;" maxlength="10"/></td>
					<td align="left"><span class="STYLE4">*</span></td>
				  </tr>
				</table></td>
                </tr>
            </table></td>
          </tr>
          
          
        </tbody>
        </table>
          <table cellspacing="1" cellpadding="0" width="100%" bgcolor="#ffffff" border="0">
           <tbody>
                <tr>
                  <td valign="middle" bgcolor="#e6f0f8"><table cellspacing="0" cellpadding="3" width="100%" border="0">
                      <tbody>
			            <tr>
              <td width="50%" height="20" align="right"><a href="javascript:createEvaluate();" onfocus="this.blur()"><img src="<%=request.getContextPath()%>/<fmt:message key='CommonImagePath' />gif-01.gif" border="0" /></a>&nbsp;</td>
              <td height="20" align="left">&nbsp;<a href="javascript:document.forms[0].reset();" onfocus="this.blur()"><img src="<%=request.getContextPath()%>/<fmt:message key='CommonImagePath' />gif-02.gif" border="0" /></a></td>
            </tr>
       				 </tbody>
                  </table></td>
                </tr>
           </tbody>
        </table>
		</td>
		<td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_09.gif"><img height="1" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />spacer.gif" width="1" /></td>
    </tr>
    <tr>
        <td><img height="22" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_10.gif" width="7" /></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_11.gif">&nbsp;</td>
        <td><img height="22" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_12.gif" width="8" /></td>
      </tr>
	</tbody>
  </table>
</html:form>
</body>
</html>
